﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WebWcf
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IDelegateSynchronization”。
    [ServiceContract]
    public interface IDelegateSynchronization
    {
        /// <summary>
        /// 给WCF传输数据 针对相同数据表结构传输
        /// </summary>
        /// <param name="updata"></param>
        /// <param name="tableName"></param>
        /// <param name="errormsg"></param>
        /// <returns></returns>
        [OperationContract]
        bool SyncData(DataTable updata, string tableName, bool isCheckColumnExist, out string errormsg);



        /// <summary>
        /// 针对可能不同表结构传输（如：SendReportQueue）
        /// </summary>
        /// <param name="updata"></param>
        /// <param name="tableName"></param>
        /// <param name="uniqueColName"></param>
        /// <param name="excludeColNames"></param>
        /// <returns></returns>
        [OperationContract]
        bool UpData(DataTable updata, string tableName, string uniqueColName, params string[] excludeColNames);



        /// <summary>
        /// 从WCF查询数据
        /// </summary>
        /// <param name="SQLString"></param>
        /// <param name="Times"></param>
        /// <returns></returns>
        [OperationContract]
        DataTable QueryTable(string SQLString, int Times = 30);
        /// <summary>
        /// 删除外网中需要删除的数据
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="errormsg"></param>
        /// <param name="keys"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteHistoryByKey(string tableName, out string errormsg, string key);

        [OperationContract]
        bool ExecuteSql(string sql);


    }
}
